home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / AmigaOS / Aplus_Dev / AP-Website / links / include / line.cat.php < prev    next >
Encoding:
PHP Script  |  2002-10-28  |  1.4 KB  |  55 lines

  1. <?
  2. // *******************************************************************
  3. //  include/line.cat.php
  4. // *******************************************************************
  5.  
  6. $htmlsrc = $table2 . "<tr><td width=\"100%\" class=\"lineCategoryText\">";
  7. $htmlsrc .= "<a class=\"lineCategoryLink\" href=\"index.php?" . session_name();
  8. $htmlsrc .= "=" . session_id() . "\">" . $line_cat_1 . "</a> ";
  9.  
  10. unset($gcid);
  11.  
  12. if(isset($PID)){
  13.     $gcid = $PID;
  14. }
  15.  
  16. while($gcid > 0){
  17.  
  18.     $mlc_sql = "select * from $tb_categories where ID = '$gcid'";
  19.     $mlc_query = sql_query($mlc_sql);
  20.     $mlc_array = sql_fetch_array($mlc_query);
  21.     $cat_array[] = $mlc_array["Category"];
  22.     $pid_array[] = $mlc_array["ID"];
  23.     $gcid = $mlc_array["PID"];
  24. }
  25.  
  26. $count = sizeof($pid_array);
  27.  
  28. for($depth=$count;$depth>=0;$depth--){    
  29.         
  30.     if($pid_array[$depth]){
  31.  
  32.         if($PID == $pid_array[$depth]){
  33.                 
  34.             $htmlsrc .= ">> ".ereg_replace("_"," ",($cat_array[$depth]));
  35.             $htmlsrc .= "  ";
  36.             
  37.         } else {
  38.                 
  39.             $htmlsrc .= ">> <a class=\"lineCategoryLink\" href=\"index.php?";
  40.             $htmlsrc .= session_name() . "=" . session_id() . "&PID=";
  41.             $htmlsrc .= $pid_array[$depth] . "\">";
  42.             $htmlsrc .= ereg_replace("_"," ",($cat_array[$depth]));
  43.             $htmlsrc .= "</a>  ";
  44.         }
  45.     }
  46. }
  47.  
  48. $htmlsrc .= "</td></tr></table>";
  49.  
  50. echo linecattable("100%","center","",$htmlsrc);
  51. unset($htmlsrc);
  52.  
  53. ?>
  54.  
  55.